/**
 * Created by enixjin on 1/10/18.
 */
import {UserService} from "../../../../service/userService";
import {AbstractUserRESTAction} from "../AbstractUserRESTAction";
import {UserListCompleteAction} from "../data";

export class UserListRESTAction extends AbstractUserRESTAction {
    constructor(private userService: UserService, private _localKey: string, private payload: any) {
        super(_localKey);
    }

    send() {
        return this.userService.list();
    }


    updateLocal(local, payload): void {
        local.set(this._localKey, payload);
    }

    getDataAction(payload) {
        return new UserListCompleteAction(payload);
    }

}
